package com.nuts.core.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.nuts.base.bean.MenuTreeVO;
import com.nuts.base.bean.RoleMenuTreeVO;
import com.nuts.base.core.BaseServiceImpl;
import com.nuts.base.core.IBaseDao;
import com.nuts.core.bean.request.MenuReqVO;
import com.nuts.core.bean.response.MenuVO;
import com.nuts.core.dao.IMenuDao;
import com.nuts.core.service.IMenuService;

/**
 * 菜单Service
 * 
 * @author 杨文
 * @date 2017年8月11日 下午3:35:08
 */
@Service
public class MenuImpl extends BaseServiceImpl<MenuReqVO, MenuVO> implements IMenuService {

	private IMenuDao menuDao;

	@Autowired
	@Override
	public void setBaseDao(IBaseDao<MenuReqVO, MenuVO> baseDao) {
		this.baseDao = baseDao;
		this.menuDao = (IMenuDao) baseDao;
	}
	
	/**
	 * 获取菜单树
	 */
	@Override
	public List<MenuTreeVO> getTree(MenuReqVO menuReqVO){
		return menuDao.getTree(menuReqVO);
	}

	@Override
	public List<RoleMenuTreeVO> getRoleTree(MenuReqVO menuReqVO) {
		return menuDao.getRoleTree(menuReqVO);
	}

}
